Conversation
|
I feel it might be better to normalize the glob instead. Say a dir without any wildcard, like |
Sorry, did you mean we will normalize the input? If the user input is 'src/utils', I will transform it to 'src/utils/*.xx'. |
|
Something like |
|
hh,ok |
src/core/ctx.ts
Outdated
|
|
||
| const dirs = options.dirs?.map(dir => resolve(root, dir)) | ||
| const filePattern = '*.{tsx,jsx,ts,js,mjs,cjs,mts,cts}' | ||
| const dirs = options.dirs?.map(dir => resolve(root, dir, !dir.includes('*') ? filePattern : '')) |
There was a problem hiding this comment.
This does not seem to handle ! right? Can we extract this as a function and do some unit test?
There was a problem hiding this comment.
yes, unplugin-vue-components already has pr: unplugin/unplugin-vue-components#645
if that pr passed, I will change unplugin-auto-import code
There was a problem hiding this comment.
@antfu I'm afraid this pr won't pass, so i am waiting.
|
scanDirExports from unimport can not work with glob exclude, so I write a new one. |
|
@lishaobos looks good. If you want, you could send a PR to unimport so we could remove the workaround here. |
of course, i will send a pr later. |
Description
config:
dir structure:
when i add new api and export in test.ts, dts can not update,
because minimatch('src/utils/test.ts', 'src/utils') return false
Linked Issues
Additional context